import re
# int_re ='(\\D+)'

##int_re = '(\\b\\d+\\b)' # positive integer - fails '0 0'
## rg = re.compile(re1,re.IGNORECASE|re.DOTALL)
#int_re = re.compile(int_re)
## print dir(int_re)

string_re = '([a-z0-9]*)'

### integers
#trues = ['1', '0', '123', '21312312453453','000']
#falses = ['abc','a', '1a','1 1', ' 1', '3.2', '-123', 'c 213', ""]
#expression = '^[0-9]+$' # works for positive int TRUE


### url names
#trues = ['abc','def','ABCDEFaaa', 'abc_ABC']
#falses = ['***', '&%$']
#expression = '(^[a-zA-Z_]*$)'

trues = ['/qweqwew']
falses = ['//']
expression = '(^/[\w][\w]*$)'

test_re = re.compile(expression)

for x in trues:
    print bool(test_re.search(x)),bool(test_re.match(x)),x
print 10 * "==="
for x in falses:
    print bool(test_re.search(x)),bool(test_re.match(x)),x















scheme_chars = ('abcdefghijklmnopqrstuvwxyz'
                'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                '0123456789'
                '+-.')

# print scheme_chars
'''
ASCII (ISO 646-US) is the character set used by e-mail and news. Valid (printable) characters are: 
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~

Also valid are the space character and the tab character.
'''